package com.zsc.rediscli.cluster;



import org.apache.commons.pool2.impl.GenericObjectPoolConfig;
import redis.clients.jedis.HostAndPort;
import redis.clients.jedis.JedisCluster;

import java.util.HashSet;

public class JedisClusterTest {

    public static void main(String[] args) {
        HashSet<HostAndPort> nodeList = new HashSet<>();
        nodeList.add(new HostAndPort("127.0.0.1",7000));
        nodeList.add(new HostAndPort("127.0.0.1",7001));
        nodeList.add(new HostAndPort("127.0.0.1",7002));
        nodeList.add(new HostAndPort("127.0.0.1",7003));
        nodeList.add(new HostAndPort("127.0.0.1",7004));

        JedisCluster jedisCluster = new JedisCluster(nodeList, 4000,new GenericObjectPoolConfig());
        jedisCluster.set("hello","world");
    }
}
